import os

from not_so_free_marker.enums import FileOpResultEnum


def read_file(file_path):
    file_context = ""
    if not os.path.exists(file_path):
        return FileOpResultEnum.FILE_NOT_FOUND, file_context
    with open(file_path, encoding="utf-8", mode="r") as f:
        file_context = f.read()
    return FileOpResultEnum.OK, file_context


def write_file(file_path, content):
    with open(file_path, encoding="utf-8", mode="w") as f:
        f.write(content)
